package com.example.wxminiprogram.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.lang.reflect.Array;
import java.util.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    public HashMap<String,Integer> meta;
    public Object message;
    public static Result success(Object object){
        HashMap<String,Integer> meta = new HashMap<>();
        meta.put("status",200);
        return new Result(meta,object);
    }
    public static Result error(String msg){
        HashMap<String,Integer> meta = new HashMap<>();
        meta.put("status",500);
        return new Result(meta,msg);
    }
}
